<template>
  <video ref="videoDemo" class="video-classzaw" autoplay></video>
</template>
 <script lang='ts' setup>
import { ref } from "vue";
const videoDemo = ref({ srcObject: null });
const props = defineProps({
  srcbj: { type: String },
});
const getstream = () => {
  return new Promise((resolve) => {
    var getUserMedia =
      navigator.getUserMedia ||
      navigator.webkitGetUserMedia ||
      navigator.mozGetUserMedia;
    console.log(getUserMedia);
    getUserMedia(
      {
        audio: true,
        video: true,
      },
      function (stream) {
        resolve(stream);
      },
      function (err) {
        resolve(false);
      }
    );
  });
};
const inide = async () => {
  let stream = await getstream();
  // let videoDemo: any = document.getElementById("videoDemo");
  videoDemo.value.srcObject = props.srcbj;
};
inide();
</script>
 <style scoped>
</style>